package com.util.vmwareops;
import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;

public class TestVMwareCronJob {

    public static void main(String [] args) throws SchedulerException {
        Scheduler scheduler = new StdSchedulerFactory().getScheduler();

        JobKey jobKey = new JobKey("CronJobToUpdateVMwareInfo");
        JobDetail jobDetail = JobBuilder.newJob(CronJobToUpdateVMwareInfo.class).withIdentity(jobKey).build();

        TriggerKey triggerKey = new TriggerKey("SchedulerVMware");
        Trigger trigger = TriggerBuilder.newTrigger().withIdentity(triggerKey).withSchedule(
                SimpleScheduleBuilder.simpleSchedule().withIntervalInMinutes(1).repeatForever()
        ).build();

        scheduler.scheduleJob(jobDetail, trigger);
        scheduler.start();
    }
}
